import Vue from "vue";
import VueRouter from "vue-router";
import home from "../views/home";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: home,
    redirect: "/home",
  },
  {
    path: "/home",
    component: (resolve) => require(["../views/home"], resolve),
  },
  {
    path: "/detail",
    component: (resolve) => require(["../views/information/detail"], resolve),
  },
  {
    path: "/technical",
    component: (resolve) => require(["../views/technical/index"], resolve),
    children: [
      {
        path: "training1",
        component: (resolve) =>
          require(["../views/technical/training1"], resolve),
      },
      {
        path: "training2",
        component: (resolve) =>
          require(["../views/technical/training2"], resolve),
      },
      {
        path: "training3",
        component: (resolve) =>
          require(["../views/technical/training3"], resolve),
      },
      {
        path: "training4",
        component: (resolve) =>
          require(["../views/technical/training4"], resolve),
      },
      {
        path: "training5",
        component: (resolve) =>
          require(["../views/technical/training5"], resolve),
      },
      {
        path: "training6",
        component: (resolve) =>
          require(["../views/technical/training6"], resolve),
      },
      {
        path: "training7",
        component: (resolve) =>
          require(["../views/technical/training7"], resolve),
      },
      {
        path: "training8",
        component: (resolve) =>
          require(["../views/technical/training8"], resolve),
      },
      {
        path: "training9",
        component: (resolve) =>
          require(["../views/technical/training9"], resolve),
      },
      {
        path: "training10",
        component: (resolve) =>
          require(["../views/technical/training10"], resolve),
      },
    ],
  },
  {
    path: "/vocationalTraining",
    component: (resolve) =>
      require(["../views/vocationalTraining/index"], resolve),
  },
  {
    path: "/production",
    component: (resolve) => require(["../views/production/index"], resolve),
    children: [
      {
        path: "pro1",
        component: (resolve) => require(["../views/production/pro1"], resolve),
      },
      {
        path: "pro2",
        component: (resolve) => require(["../views/production/pro2"], resolve),
      },
      {
        path: "pro3",
        component: (resolve) => require(["../views/production/pro3"], resolve),
      },
      {
        path: "pro4",
        component: (resolve) => require(["../views/production/pro4"], resolve),
      },
      {
        path: "pro5",
        component: (resolve) => require(["../views/production/pro5"], resolve),
      },
      {
        path: "pro6",
        component: (resolve) => require(["../views/production/pro6"], resolve),
      },
      {
        path: "pro7",
        component: (resolve) => require(["../views/production/pro7"], resolve),
      },
      {
        path: "pro8",
        component: (resolve) => require(["../views/production/pro8"], resolve),
      },
    ],
  },
  {
    path: "/information",
    component: (resolve) => require(["../views/information/index"], resolve),
  },
  {
    path: "/detail/:id",
    component: (resolve) => require(["../views/information/detail"], resolve),
  },
  {
    path: "/notification",
    component: (resolve) => require(["../views/notification"], resolve),
  },
  {
    path: "/aboutUs",
    component: (resolve) => require(["../views/aboutUs/index"], resolve),
    // children: [
    //   {
    //     path: "index1",
    //     component: (resolve) => require(["../views/aboutUs/index"], resolve),
    //   },
    //   {
    //     path: "index2",
    //     component: (resolve) => require(["../views/aboutUs/index"], resolve),
    //   },
    //   {
    //     path: "index3",
    //     component: (resolve) => require(["../views/aboutUs/index"], resolve),
    //   },
    // ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
